<script type="text/html" template lay-done="layui.data.done(d);">

    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-skucolor-createForm" id="LAY-app-skucolor-createForm">

        <!--<div class="layui-form-item">
        <label for="id" class="layui-form-label  layui-form-required"></label>
        <div class="layui-input-block ">
            <input  type="number" min="0" max="999999" name="id"   lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入" lay-reqText="请输入并为数字"  />
        </div>
    </div>-->

        <div class="layui-form-item">
            <label for="goodstypespecvalueId" class="layui-form-label  layui-form-required"> sku颜色</label>
            <div class="layui-input-block">
                <!--<input type="number" min="0" max="999999" name="goodstypespecvalueId" lay-verType="tips" lay-verify="required|number" class="layui-input" placeholder="请输入" lay-reqText="请输入并为数字" />-->

                <div class="layui-input-inline">
                    <select name="goodstypespecvalueId" id="goodstypespecvalueId">
                        <option value="">请选择颜色sku</option>
                        {{# layui.each(skus, function(index, item){ }}
                        <option value="{{ item.id }}">{{ item.value }}</option>
                        {{# }); }}
                    </select>
                </div>

            </div>
        </div>

        <div class="layui-form-item">
            <label for="color" class="layui-form-label  layui-form-required"> 对应值</label>
            <div class="layui-input-block">
                <input name="color" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入" lay-reqText="请输入" />
            </div>
        </div>

        <div class="layui-form-item">
            <label for="boscode" class="layui-form-label  layui-form-required"> 伯俊编号</label>
            <div class="layui-input-block">
                <input name="boscode" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入" lay-reqText="请输入" />
            </div>
        </div>


  
        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-skucolor-createForm-submit" id="LAY-app-skucolor-createForm-submit" value="确认添加">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    var skus;
    layui.data.done = function (d) {
        //开启调试情况下获取接口赋值数据
     
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg', 'dropdown'],
        function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , laydate = layui.laydate
                , upload = layui.upload
                , cropperImg = layui.cropperImg
                , dropdown = layui.dropdown
                , coreHelper = layui.coreHelper;
	        
	        form.verify({
                
            });

            coreHelper.Get("Api/SkuColor/GetSku", function (e) {
           
                skus=e.data
                if (debug) { console.log(skus); } //开启调试返回数据
             
              
                form.render(null, 'goodstypespecvalueId');

            });


            //重载form
            form.render(null, 'LAY-app-skucolor-createForm');
        })
    };
</script>
